import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace OrderServiceItemsApi {
  /** 订单服务项信息 */
  export interface OrderServiceItems {
    id: number; // 
    orderId?: string; // 订单ID
    serviceType?: string; // 服务类型(DRESS/MAKEUP/PHOTO)
    serviceCode: string; // 服务编码
    serviceName: string; // 服务名称
    quantity: number; // 数量
    unitPrice: number; // 单价
    totalPrice: number; // 小计
    bookingId: string; // 关联预约ID
    status: string; // 状态
  }
}

/** 查询订单服务项分页 */
export function getOrderServiceItemsPage(params: PageParam) {
  return requestClient.get<PageResult<OrderServiceItemsApi.OrderServiceItems>>('/wedding/order-service-items/page', { params });
}

/** 查询订单服务项详情 */
export function getOrderServiceItems(id: number) {
  return requestClient.get<OrderServiceItemsApi.OrderServiceItems>(`/wedding/order-service-items/get?id=${id}`);
}

/** 新增订单服务项 */
export function createOrderServiceItems(data: OrderServiceItemsApi.OrderServiceItems) {
  return requestClient.post('/wedding/order-service-items/create', data);
}

/** 修改订单服务项 */
export function updateOrderServiceItems(data: OrderServiceItemsApi.OrderServiceItems) {
  return requestClient.put('/wedding/order-service-items/update', data);
}

/** 删除订单服务项 */
export function deleteOrderServiceItems(id: number) {
  return requestClient.delete(`/wedding/order-service-items/delete?id=${id}`);
}


/** 导出订单服务项 */
export function exportOrderServiceItems(params: any) {
  return requestClient.download('/wedding/order-service-items/export-excel', { params });
}

